package com.tiger.bmpeb.sample65;

import java.rmi.RemoteException;

import javax.ejb.CreateException;
import javax.naming.InitialContext;
import javax.naming.NamingException;
import javax.rmi.PortableRemoteObject;

public class Client1 {

	public static void main(String[] args) {

		try {
			InitialContext ctx = new InitialContext();
			Object obj = ctx.lookup("comp/env/ejb/CustomerBean04");
			CustomerHome04 customerHome = (CustomerHome04) PortableRemoteObject.narrow(obj, CustomerHome04.class);

			CustomerID customerID = new CustomerID(1);
			Customer04 customer = customerHome.create(customerID, "Suzuki Taro", 20);
		} catch (NamingException e) {
			e.printStackTrace();
		} catch (RemoteException e) {
			e.printStackTrace();
		} catch (CreateException e) {
			e.printStackTrace();
		}
	}

}
